var eventHandler = {};

// Require.js allows us to configure shortcut alias
require.config({
	// The shim config allows us to configure dependencies for
	// scripts that do not call define() to register a module
	shim: {
		underscore: {
			exports: '_'
		},
		backbone: {
			deps: [
				'underscore',
				'jquery',
				'jqueryUI'
			],
			exports: 'Backbone'
		}
	},
	paths: {
		jquery: '../assets/scripts/jquery.min',
		jqueryUI: '../assets/scripts/jquery-ui.min',
		underscore: '../assets/scripts/lodash.min',
		backbone: 'lib/backbone/backbone',
		text: 'lib/require/text'
	}
});

require([
	'routers/router'
], function( Router ) {
	// Initialize routing and start Backbone.history()
	_.extend(eventHandler, Backbone.Events);

	new Router();
	Backbone.history.start();


	//eventHandler.on("alert", function(msg) {
	//  alert("Triggered " + msg);
	//});

	//eventHandler.trigger("alert", "an event");

	// Initialize the application view
});
